Create a new database attached as sub-database of the database identified
by {id|name}
.
Request Headers | |
---|---|
Content-type |
The MIME type of the data in the request body. Supported values:
application/xml , application/json .
|
Upon success, MarkLogic server returns status code 201 (Created).
manage-admin
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/manage-admin
kind
element of the input configuration to
either active
or archive
.
For details, see
tieredstorage:database-create-sub-database
and
Sub-databases and Super-databases in the Administrator's Guide.
The structure of the data in the request body is as follows:
database-name
kind
$ cat subdb-create.xml ==> <sub-database xmlns="http://marklogic.com/manage"> <database-name>sub-1</database-name> <kind>active</kind> </sub-database> $ curl --anyauth --user user:password -X POST -d @./subdb-create.xml \ -i -H "Content-type: application/xml" \ http://localhost:8002/manage/v2/databases/super-db/sub-databases ==> Create a database named sub-1 and make a sub-database of super-db. MarkLogic Server responds with status code 201 (Created) and headers similar to the following: HTTP/1.1 201 Created Content-type: application/xml Cache-Control: no-cache Expires: -1 Server: MarkLogic Content-Length: 0 Connection: Keep-Alive Keep-Alive: timeout=5
$ cat subdb-create.json ==> { "database-name": "sub-1", "kind": "active" } $ curl --anyauth --user user:password -X POST -d @./subdb-create.json \ -i -H "Content-type: application/json" \ http://localhost:8002/manage/v2/databases/super-db/sub-databases ==> Create a database named sub-1 and make a sub-database of super-db. MarkLogic Server responds with status code 201 (Created) and headers similar to the following: HTTP/1.1 201 Created Content-type: application/xml Cache-Control: no-cache Expires: -1 Server: MarkLogic Content-Length: 0 Connection: Keep-Alive Keep-Alive: timeout=5
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.